import { GET, POST, request } from './request'

// 发送验证码
export const captchaSent = (params?: any) => GET('http://120.26.90.83:3000/captcha/sent', params)

// 验证验证码是否正确
export const captchaVerify = (params?: any) => GET('http://120.26.90.83:3000/captcha/verify', params)

// 查询手机号是否注册
export const findUser = (params?: any) => POST('/app/finduser', params)

// 完成注册
export const register = (params: any) => POST('/app/register', params)

// 登录
export const loginApi = (params: any) => POST('/app/login', params)

export const changepassAPI = (params?: any) => POST('/app/changepass', params)   // 修改密码

// 获取token
export const getToken = (params: any) => POST('app/gettoken', params)

// 上传文件
export const uplodafileAPI = (params: any) => POST('/app/uplodafile', params)

// 获取用户信息
export const getuserInfo = (params?: any) => GET('/app/getuserinfo', params)

// 修改用户信息
export const changeuserinfoAPI = (params: any) => POST('/app/changeuserinfo', params)

// 获取分类列表
export const getalltravelsAPI = (params?: any) => POST('/app/getalltravels', params)

// 获取城市
// export const getCityList = (params: any, header: any) => GET('http://192.168.58.232:3000/app/getmaizuo', params, header)
export const getMaiZuoDataAPI = (params?: any, headers?: any) => GET('https://m.maizuo.com/gateway', params, headers)

// 添加旅游日记
export const addtravelsAPI = (params?: any) => POST('/app/addtravels', params)

// 获取详情页
export const gettravelbyidAPI = (params?: any) => POST('/app/gettravelbyid', params)

// 获取我的旅游日记
export const getmytravelsAPI = (params?: any) => POST('/app/getmytravels', params)

// 获取轮播图
export const gettravelbannersAPI = (params?: any) => POST('/app/gettravelbanners', params)

// 获取主页列表数据
export const gethomelistAPI = (params?: any) => POST('/app/gethomelist', params)

// 修改旅游数据
export const changetravelsAPI = (params?: any) => POST('/app/changetravels', params)

// 点赞的列表数据
export const getlikelistAPI = (params?: any) => POST('/app/getlikelist', params)

// 收藏的列表
export const getcollectlistAPI = (params?: any) => POST('/app/getcollectlist', params)

// 取消点赞
export const dellikeoneAPI = (params?: any) => POST('/app/dellikeone', params)

// 点赞
export const addlikeoneAPI = (params?: any) => POST('/app/addlikeone', params)

// 取消收藏
export const delcollectoneAPI = (params?: any) => POST('/app/delcollectone', params)

// 收藏添加
export const addcollectoneAPI = (params?: any) => POST('/app/addcollectone', params)

// 评论列表
export const getpinglistAPI = (params?: any) => POST('/app/getpinglist', params)
